home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 19 / Mac Magazin and MacEasy Magazine CD - Issue 19.iso / Wissenschaft & Technik / Open Prolog / Documents / Release Notes < prev    next >
Text File  |  1996-01-07  |  16KB  |  165 lines

  1. Version 1.0.3d26
  2.  
  3. •• New Features
  4. • The text editor understands bracket balancing: double click on a bracket to select everything between it and its corresponding bracket - works for ( ) [ ] and { }, and also these pairs:  «  »  ‘ ’ and “ ”.
  5. • A dialog toolkit is currently being added. See a separate folder called Dialogs.
  6. • User-added menus, the Quit menu item in the File menu and all the items under the Prolog menu are now continuously activated, being serviced by interrupt handlers within Open Prolog. Hitherto, Open Prolog had to be reading for the menu action to be recognised.
  7. • Following a discussion about 'defining' predicates on comp.lang.prolog, Open Prolog now distinguishes between 'defined' and 'undefined' predicates in a way that seems to be a standard among recent Prolog implementations, as follows:
  8. A user predicate is defined by asserting clauses for that predicate, or by declaring the predicate to be 'dynamic' with the :-dynamic(Functor/Arity) directive. For example,
  9. :-dynamic(a/0).
  10. will 'define' the predicate a/0, though it adds no clauses.
  11. An existing predicate is undefined by abolishing it with abolish(Functor,Arity). For example:
  12. abolish(a,0).
  13. will remove all the clauses for the predicate a/0 and will also undefine it.
  14. Note that retract/1 never undefines a predicate.
  15.  
  16. So, a predicate can be
  17. 1. defined, with clauses;
  18. 2. defined, with no clauses;
  19. 3. undefined, with no clauses.
  20.  
  21. If a call is made, one of the three above cases holds. Case 1 is normal. In case 2, the call will simply fail. In case 3, the behaviour of the interpreter depends on the setting of the 'unknown' flag (use unknown(CurrentFlag,NewFlag) to find out). If the 'unknown' flag is 'fail', then the call will just fail; if the 'unknown' flag is 'trace' then the debugger will be called.
  22. Some predicates may legitimately have no clauses in them at a particular time, and calls to them should simply fail, even when the unknown flag is set to 'trace'. Those predicates can be 'defined' by declaring them to be dynamic.
  23. It is useful when debugging programs to set the 'unknown' flag to 'trace' so that you're notified if there are any undefined predicates being called. Using define/1, you can ensure that calls to predicates that legitimately have no clauses in them will not result in calls to the debugger.
  24. • copy_term/2 added.
  25. • in the light of a discussion on comp.lang.prolog about 'all solutions', bagof/3 has been modified to comply with the ISO Standard regarding the order in which solutions appear in the solution list in the presence of free variables. Specifically, the order of the solutions is the order in which they are discovered. Hitherto, the order was somewhat unpredictable.
  26. • Drag and drop support has been added. Every drag is a _copy_, never a _move_ because the undo mechanism needs to be updated to accommodate undo-able moves.
  27. • Speed - many simple built-ins have been greatly speeded up, and other components tuned up. You can expect a speed improvement of 10% to 20% in general work.
  28. • in compliance with the ISO draft, close/1 _never_ returns an error and always succeeds.
  29. • for compatability with other prologs, statistics/2 has been added.
  30.   E.g. statistics(runtime,X) will return X unified with a list containing runtime
  31.   and time since the last 'statistics' call.
  32. • the built-in statistics/0 has been modified to look more like other prologs.
  33. • what was called gc in Open Prolog has been renamed garbage_collect for compatability.
  34.  
  35. ••Bug Fixes & Improvements
  36. • Better system error messages.
  37. • Fixed a bug in retract/1 introduced when removing another bug (see below). Fixed in 1.0.3d25.
  38. • Fixed a few missing pictures in 'Getting Started' Thank you m***os**t - not.
  39. • Fixed a few errors in the documentation and in the Dialog Samples code.
  40. • Fixed a bug with menu highlighting - it was left on when a control panel item was selected using  hierarchical menus (Fixed in 1.0.3d24)
  41. • Fixed an infelicity in the arrow keys. If there is a non-empty selection, the left arrow/right arrow merely now just the caret to the left or right end as appropriate. Also, pressing the down arrow moves the caret one line down from the _end_ of the selection. (This is similar to most word and text processors and is not done automatically by TextEdit, the underlyinh text manager). (Done in 1.0.3d24)
  42. • Fixed another infelicity with autoindent. If you used autoindent to automatically indent a line that began with with spaces and tabs, they were left in place, so the text wasn't lined up properly. (Fixed in 1.0.3d24)
  43. • Fixed a bug in retract/1 - if it failed, it left garbage collection switched off (fixed in 1.0.3d23).
  44. • Fixed bugs with handling the resource needed to store a window's position information. Occasionally it may have crashed the machine.
  45. • The debugger has always used the print/1 predicate for writing the predicate involved in the call/exit/redo/exit, so you can substitute what you like with portray/1. If you don't have your own portray clauses, the debugger now uses writeq/1 rathar than write/1.
  46. • DCG expander now handles -> and \+ ¬ and not/1 properly, and expands variables on rhs as calls to phrase/3.
  47. • fixed bug whereby Open Prolog stayed open, with no worksheet open (so you couldn't easily quit from it) after asking it to print documents from the desktop.
  48. • fixed bug in current_op whereby it would not agree that a postfix operator had been defined.
  49. • fixed bug in bagof/findall/setof when the item to be kept is a variable. What was happening was that all the variables were unified together. Huh.
  50. • fixed bug in write where a term of the form $VAR(N) was to be written. If N is an integer, this term prints as a variable name. If not, write/1 was aborting.
  51. • various garbage collection bugs fixed (1.0.3d18 & 1.0.3d19)
  52. • a bug causing some menu items to disappear has been fixed (1.0.3d17)
  53. • a bug causing OP to hang when asked for the length of a list of indeterminate length has been fixed. It also caused =../2 to hang if both arguments were variable
  54. • some arithmetic overflow checks have been tightened up
  55. • you can really close windows in System 6 non-multifinder systems now. (1.0.3d16)
  56. • following a discussion on comp.lang.prolog about all solutions, bagof has been modified to comply with the ISO Standard regarding the order in which solutions are proposed in the presence of free variables. (1.0.d15)
  57. • various crash bugs on 68000 machines running System 6 fixed. (1.0.3d15)
  58. • calculation of memory allocation on the About… Screen has been fixed for 68000 based machines. (1.0.3d15)
  59. • a cause of crashes on machines without drag and drop has been fixed (1.0.3d14)
  60. • arithmetic comparison errors (ahem) fixed. (1.0.3d12)
  61. • the ersatz file 'user' can now be consulted and reconsulted from as before.
  62. • an initialisation race condition which caused crashes on faster Macs - e.g. LC 475/ LC 630s has been removed.
  63. • when writing output, an automatic space incorrectly inserted between punctuation and other symbol characters was causing trouble - e.g. if read back in, a dot followed by a space before something else was being treated as an end-of-clause marker. This has been fixed. 
  64. • Consult and reconsult each had a bogus backtrack point (apart from open/3) - removed.
  65. • open/3 had a bogus backtrack point in read mode - removed.
  66. • on abort or on exit from the Open Prolog System Error dialog, open streams are flushed and closed.
  67. • Fixed various bugs occuring when run from a shared volume, a locked volume (e.g. CD-ROM), or in a system with a locked or invisible System Folder
  68. • Command-dot is more robust. The user_interrupt it threw was sometimes absorbed when nofileerrors was active and the interrupt was thrown up through a file handling predicate.
  69. • numbervars/3 has been changed to replace variables with the terms '$VAR(N)' where N is an integer from 0 upwards in left to right traversal order. Predicates write and writeq have been modified to output atoms starting at A, B, C and so on, A1, B1, C1 etc whenever the term '$VAR(N)' occurs in a term to be written (see the ISO Prolog Draft for details). So, overall, the effect of using numbervars and write is the same as before. What's important though is that then internal arrangments, which were awful beyond belief, and which occasionally caused gc problems, are now regularised.
  70.  
  71. Version 1.0.2
  72.  
  73. Big News
  74. • Open Prolog runs on the Power Macs. Hold on, though, it runs in emulated mode, so it doesn't exactly race along. To be exact, on a prerelease 8100/80, it ran naive reverse at 21kLips (about three times a IIx). All the same, it's heartening.
  75.  
  76. •• Bug Fixes & Improvements
  77. • Some changes have been made to the handling of unexpected end of file conditions, to try to improve error detection.
  78. • On Quadra 660AVs, OP seemed to run out of scratch memory. This has been cured by increasing the amount of scratch memory reserved at startup. OP is not smart about memory demands for opening windows or consulting documents; if there isn't enough memory allocated, OP is unable to get any more and may get into trouble as a consequence.
  79. • Sometimes, in System 7, OP didn't figure out which folder was the current folder. This bug has been present in all versions that run under System 7, and may have been the cause of some mysterious problems.
  80. • When a file is being consulted or reconsulted, all directives - goals preceded by :-, are executed. This idea is now extended to include calls preceded by ?-, so that goals preseded by ?- in a file being consulted or reconsulted will also be executed.
  81. • A bug which crashed the machine when a quote was preceded by a digit and followed by other than a digit was fixed. The bug was introduced when OP became capable of using bases other than 10.
  82. • OP now recognises a number specification of the form 0'<character> as being an integer whose value is the character code of <character>. For example, if you entered:
  83. X is 0'a.
  84. you'd get X = 97 (the character code for 'a').
  85. • OP has stopped complaining about an empty list with white space in it.
  86. • Sometimes it is impossible to assert a given clause, either because an attempt is made to redefine a built-in predicate or because some part of the body is illegal (e.g. an integer call). OP now (at least) reports the clause and the kind of error.
  87. • OP would only consult or reconsult an open window if the file in the window happened to be in the home folder. This restriction has been removed.
  88. • If a file is open in a window, OP will ask you if it's OK to close it if it's to be written to, and will ask you if it's OK to save it before opening it for reading.
  89.  
  90. •• New features.
  91. Many big changes have occured beneath the surface of Open Prolog - all for the better, and all compatible with previous versions.
  92.  
  93. - Many of Open Prolog's built-in predicates are themselves written in Prolog and compiled. The biggest internal change has been a significant revision to the compiler, linker and loader which collectively had a 64 kByte limit, causing much grief. This limit has now been removed, and the loading procedures have been modified to offer greater flexibility.
  94.  
  95. - Open Prolog checks a special folder, called Open Prolog Additions, in the Extensions Folder (or the System Folder in System 6). External Predicates,  separately compiled Prolog code, and other Macintosh Resources can be placed in Open Prolog extension files. These files have a distinctive Open Prolog icon and, if placed in the Open Prolog Additions Folder, are opened for use at startup. In addition, if a file called 'Open Prolog Options' can't be found in the Startup Folder, it will be consulted if it's present in Open Prolog Additions.
  96. There are two extension files with this release of Open Prolog:
  97. 'Environment' implements a suggestion of Richard O'Keeffe's providing details of the Prolog environment in a standard way by making calls to environment/1.
  98. 'debugStartAction' prints the date and time at the start of a trace session.
  99.  
  100. - A new way of specifying files and folders, based on the Macintosh File Specification, has been developed.
  101.  
  102. The full, canonical, specification of a folder is now:
  103. folder(VolumeNumber,IndexNumber).
  104. A number of standard folders have special 4-letter abbreviations, and these abbreviations can be used instead of the folder specification given above. The four standard folder abbreviations supported directly by Open Prolog are: 
  105. 'Strt' - Startup Folder. This is the folder containing Open Prolog itself.
  106. 'Home' - Home Folder. This is the folder initially containing the Open Prolog Worksheet.
  107. 'Addn' - Additions Folder. This is the folder 'Open Prolog Additions' contained in the Extensions Folder (the System Folder for System 6).
  108. 'Curr' - Current Folder. Initially the Home Folder, this can be set using the set_folder predicate.
  109. Under System 7, Open Prolog also recognises all System 7 abbreviations for special folders, including such useful ones as 'desk' for the desktop, 'macs' for the System Folder, 'temp' for the Temporary Items folder, and many others. 
  110.  
  111. The canonical specification of a file is now:
  112. file(<FolderSpecification>,Name)
  113. where <FolderSpecification> is as described above. Whenever a file is to be used, the specification you give is resolved to the standard, and is then used.
  114. If you specify a file simply by giving its name, then it is expected to be in the current folder. Partial pathnames and full pathnames are resolved correctly.
  115.  
  116.  
  117. - New file handling predicates. These are based loosely on some of the ISO draft I/O predicates and use the new file specification scheme described above. Note that the name of standard input and output is simply 'user', not 'user_input' or 'user_output'.
  118.  
  119. The new predicates are:
  120.  
  121. open(FileSpec,Mode,Stream)
  122.       FileSpec is anything sensible, e.g. a full file specification, just an name,
  123.       or a folder and name
  124.       Mode is read, write or append
  125.       Stream is either an automatically generated Stream ID - an integer - or an atom
  126.         of your choosing (the atom mustn't be the Stream ID of another stream).
  127.      The file specified is opened, but the stream doesn't become the current input or
  128.      output stream automatically.
  129.  
  130. close(Stream)
  131.  
  132. set_input(Stream)
  133.  
  134. set_output(Stream)
  135.  
  136. current_input(Stream)
  137.  
  138. current_output(Stream)
  139.  
  140. canonicalFileSpec(FileDescription,FileSpec).
  141. returns the canonical specification of the item described in the FileDescription. If the item is a folder, then a canonical folder description is returned. If the item is a file, the canonical file description is returned, including the file's name correctly capitalised just as it appears in the finder. 
  142. NOTE - the File or folder must exist!
  143.  
  144. stream_property(Stream,Property).
  145. Properties currently disclosed are: file_name(Name), file_spec(FileSpec), position(N), size(Size), reposition(false), type(text), eof_action(error), mode(Mode).
  146.  
  147. fileerrors - enables reporting of file errors
  148.  
  149. nofileerrors - disables reporting of file errors.
  150.  
  151. If errors occur and fileerrors are enabled, the error terms are thrown.
  152. If errors occur when fileerrors are disabled, the predicates fail quietly.
  153.  
  154. - New window handling predicates.
  155.  
  156. open_window(FileSpec,Window,CloseAction)
  157. The file specified is opened into the Window whose index number is returned. The normal close action to specify is confirm_close - the user will then be asked whether to save a changed window before closure. If you specify dont_confirm_close, the file will be saved automatically on closure.
  158. If the file is already open in a window, no new window is opened; instead the old window is brought to the front.
  159.  
  160. window_property(Window,Property).
  161. This is modelled on stream_property/2 and discloses the following properties: window_name(Name) file_attached(Boolean) file_spec(FileSpec)  file_and_window_contents_match(Boolean) (this will be false if the window is 'dirty'). The last two properties are not disclosed if no file is attached.
  162.  
  163. read_with_progress(X)
  164. This predicate reads a term from the current input source, and (if it's not 'user') sets the progress indicator to the ratio of position to stream size. Note that it doesn't cause the progress indicator to be made visible. You should show it beforehand and hide it afterwards. The number of calls to hide the progress indicator should balance the number of calls to show it.
  165.